package solution

import "math"

func V1(nums []int) int {
	max := nums[0]

	for from := 0; from < len(nums); from++ {
		for to := from; to < len(nums); to++ {
			sum := 0

			for i := from; i <= to; i++ {
				sum += nums[i]
			}

			max = int(math.Max(float64(max), float64(sum)))
		}
	}

	return max
}
